home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 1.3 KB | 49 lines | [TEXT/CWIE] |
- // MenuBarObject.h
-
- #ifndef MenuBarObject_h
- #define MenuBarObject_h
-
- #ifndef Prepositions_h
- #include "Prepositions.h"
- #endif
- #ifndef MenuObject_h
- #include "MenuObject.h"
- #endif
- #ifndef MenuManagerUser_h
- #include "MenuManagerUser.h"
- #endif
- #ifndef MenuResult_h
- #include "MenuResult.h"
- #endif
- #ifndef Key_h
- #include "Key.h"
- #endif
-
- enum AsSecondaryMenu{ asSubmenu, asPopup };
-
- class MenuBarObject: public MenuManagerUser
- {
- public:
- void Add( const MenuObject& menu, AfterEnd ) { InsertMenu( menu, 0 ); }
- void Add( const MenuObject& menu, AsSecondaryMenu ) { InsertMenu( menu, -1 ); }
- void Add( const MenuObject& menu, After, const MenuObject& previous )
- { InsertMenu( menu, previous.ID() ); }
-
- void Remove( const MenuObject& menu ) { DeleteMenu( menu.ID() ); }
-
- void Highlight( const MenuObject& menu ) { HiliteMenu( menu.ID() ); }
- void HighlightNone() { HiliteMenu( 0 ); }
-
- void Invert( const MenuObject& menu ) { FlashMenuBar( menu.ID() ); }
-
- int16 Height() const { return GetMBarHeight(); }
- void Draw() { DrawMenuBar(); }
- void Invalidate() { InvalMenuBar(); }
-
- MenuResult Click( Point p ) { return MenuSelect( p ); }
- MenuResult Key( ::Key );
- MenuResult LastAttempt() const { return MenuChoice(); }
- };
-
- #endif
-